home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / rdflib / sparql / bison / FunctionLibrary.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  3.5 KB  |  86 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''
  5. [28] FunctionCall ::= IRIref ArgList
  6. http://www.w3.org/TR/rdf-sparql-query/#evaluation
  7. '''
  8. from Util import ListRedirect
  9. STR = 0
  10. LANG = 1
  11. LANGMATCHES = 2
  12. DATATYPE = 3
  13. BOUND = 4
  14. isIRI = 5
  15. isURI = 6
  16. isBLANK = 7
  17. isLITERAL = 8
  18. FUNCTION_NAMES = {
  19.     STR: 'STR',
  20.     LANG: 'LANG',
  21.     LANGMATCHES: 'LANGMATCHES',
  22.     DATATYPE: 'DATATYPE',
  23.     BOUND: 'BOUND',
  24.     isIRI: 'isIRI',
  25.     isURI: 'isURI',
  26.     isBLANK: 'isBLANK',
  27.     isLITERAL: 'isLITERAL' }
  28.  
  29. class FunctionCall(object):
  30.     
  31.     def __init__(self, name, arguments = None):
  32.         self.name = name
  33.         if not arguments is None or []:
  34.             pass
  35.         self.arguments = arguments
  36.  
  37.     
  38.     def __repr__(self):
  39.         return ','.join % ([], []([ i for i in self.arguments ]))
  40.  
  41.  
  42.  
  43. class ParsedArgumentList(ListRedirect):
  44.     
  45.     def __init__(self, arguments):
  46.         self._list = arguments
  47.  
  48.  
  49.  
  50. class ParsedREGEXInvocation(object):
  51.     
  52.     def __init__(self, arg1, arg2, arg3 = None):
  53.         self.arg1 = arg1
  54.         self.arg2 = arg2
  55.         self.arg3 = arg3
  56.  
  57.     
  58.     def __repr__(self):
  59.         if not isinstance(self.arg1, ListRedirect) or self.arg1.reduce():
  60.             pass
  61.         if not isinstance(self.arg2, ListRedirect) or self.arg2.reduce():
  62.             pass
  63.         if not isinstance(self.arg3, ListRedirect) or self.arg3.reduce():
  64.             pass
  65.         return 'REGEX(%s,%s%s)' % (self.arg1, self.arg2, self.arg3)
  66.  
  67.  
  68.  
  69. class BuiltinFunctionCall(FunctionCall):
  70.     
  71.     def __init__(self, name, arg1, arg2 = None):
  72.         if arg2:
  73.             arguments = [
  74.                 arg1,
  75.                 arg2]
  76.         else:
  77.             arguments = [
  78.                 arg1]
  79.         super(BuiltinFunctionCall, self).__init__(name, arguments)
  80.  
  81.     
  82.     def __repr__(self):
  83.         return ','.join % ([], []([ i for i in self.arguments ]))
  84.  
  85.  
  86.